import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/Home'

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: Home
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/cart',
    name: 'Cart',
    component: ()=>import("../views/cart/Cart")
  },
  {
    path: '/profile',
    name: 'Profile',
    component: ()=>import("../views/profile/Profile")
  },
  {
    path: '/category',
    name: 'Category',
    component: ()=>import("../views/category/Category")
  },
  {
    path: '/detail/:id',
    name: 'Detail',
    component: ()=>import("../views/detail/Detail")
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
